<template>
  <h2>{{ content }}</h2>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";

export default defineComponent({
  async setup() {
    /* 模拟延迟一秒获取数据 */
    const getData = async () => {
      await new Promise(resolve=> setTimeout(resolve, 1000));
      return "异步组件获取的内容";
    };

    const content = await getData();
    return { content };
  },
});
</script>

<style scoped></style>
